<?php 
/************************************************************************************************
*   This file is a part of JV-LinkExchanger, a link exchange component for Joomla
*   Copyright (C) 2007-2008  Vijaykumar Niranjan 
*	
*   This program is free software; you can redistribute it and/or modify 
*   it under the terms of the GNU General Public License as published by 
*   the Free Software Foundation; either version 2 of the License, or 
*  (at your option) any later version. 
*
*   This program is distributed in the hope that it will be useful, 
*   but WITHOUT ANY WARRANTY; without even the implied warranty of 
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
*   GNU General Public License for more details. 
*
*   You should have received a copy of the GNU General Public License 
*   along with this program; if not, write to the Free Software 
*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* 	JV-LinkExchanger - Link Exchange Component for Joomla 1.0.x
* 	@package JV-LinkExchanger
* 	@file version 1.2.5 RELEASE
* 	@author Vijaykumar Niranjan
* 	@link http://www.jv-extensions.com
* 	@copyright (C) 2007-2008 by Vijaykumar Niranjan
* 	@license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*  	This program is distributed with the hope that it will be useful,
*  	but WITHOUT ANY WARRANTY; without even the implied warranty of
*  	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
***************************************************************************************************/
// ensure this file is being included by a parent file  
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); 
#******************************************************************************************************
// ensure user has access to this function 
if (!($acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'all') || $acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'com_jvlinx'))) { 
    mosRedirect('index2.php', _NOT_AUTH); 
} 
#******************************************************************************************************
mosCommonHTML::loadJquery();
mosCommonHTML::loadOverlib();
// Default is english.php. Check for others
$JVL = array();
global $JVL;

$lang_file =  $mosConfig_absolute_path."/administrator/components/com_jvlinx/lang/admin_".$mosConfig_lang.".php";
if (file_exists($lang_file)) 
	include($lang_file);
else
	include($mosConfig_absolute_path."/administrator/components/com_jvlinx/lang/admin_english.php");	 
#******************************************************************************************************
$JVG = array();
global $JVG;

$JVG['SERVER_NEWVERSION_URL'] 	= "http://www.yar-it.com/jvlink/jvbe.vers.txt"; // Server new version URL
$JVG['IMG_BASE_PATH'] 			= $mosConfig_live_site . "/administrator/components/com_jvlinx/images"; // Image base path
$JVG['EXT_PATH']				= "/components/com_jvlinx/banners";
$JVG['BANNER_UPLOAD_DIR']		= $mosConfig_live_site.$JVG['EXT_PATH'];
#******************************************************************************************************
error_reporting(0);
#******************************************************************************************************
require_once($mainframe->getPath('admin_html')); 
require_once($mainframe->getPath('class')); 
#*****************************************************************************************************
$act = mosGetParam($_REQUEST, 'act', '');
$option = mosGetParam($_REQUEST, 'option', '');
$task = mosGetParam($_REQUEST, 'task', '');
#******************************************************************************************************
switch ($task)
{
	case "viewcat":				HTML_jvlinx::B_CAT_display_categories($option); break;	
	case "viewconfig": 			HTML_jvlinx::B_CFG_display_settings_form($option); break;
	case "newcatform":			HTML_jvlinx::B_CAT_display_newcategory_form($option); break;	
	case "editcatform":			HTML_jvlinx::B_CAT_display_editcategory_form($option); break;		
	case "saveconfig":			HTML_jvlinx::B_CFG_process_settings($option); break;	
	case "addcat":				HTML_jvlinx::B_CAT_process_newcategory($option); break;		
	case "editcat":				HTML_jvlinx::B_CAT_process_editcategory($option); break;		
	case "delcat":				HTML_jvlinx::B_CAT_process_delcategory($option); break;			
	case "cat_snapon":			HTML_jvlinx::B_CAT_process_catsnapon($option); break;			
	case "cat_snapoff":			HTML_jvlinx::B_CAT_process_catsnapoff($option); break;				

	case "viewlinks":			HTML_jvlinx::B_LINK_display_bannerlinks($option); break;	
	case "newlinkform":			HTML_jvlinx::B_LINK_display_newbannerlink_form($option); break;	
	case "editlinkform":		HTML_jvlinx::B_LINK_display_editbannerlink_form($option); break;		 
	case "movelinkform":		HTML_jvlinx::B_LINK_display_movebannerlink_form($option); break;			
	case "addlink":				HTML_jvlinx::B_LINK_process_newbannerlink($option); break;			
	case "editlink":			HTML_jvlinx::B_LINK_process_editbannerlink($option); break;		
	case "movelink":			HTML_jvlinx::B_LINK_process_movelink($option); break;		
	case "dellink":				HTML_jvlinx::B_LINK_process_deletebannerlink($option); break;			
	case "lnk_snapon":			HTML_jvlinx::B_LINK_process_linksnapon($option); break;			
	case "lnk_snapoff":			HTML_jvlinx::B_LINK_process_linksnapoff($option); break;				
	case "rlc_links_exec":		HTML_jvlinx::exec_RLC_bannerlinks($option); break;		
	case "rlc_catlinks_exec":	HTML_jvlinx::exec_RLC_catbannerlinks($option); break;		
	case "fe_link_approve":		HTML_jvlinx::B_LINK_process_approvefelink($option); break;
	
	case "about":				
	case "cancel":	
	default: 					HTML_jvlinx::B_INTRO_about_product($option); break;
}
#******************************************************************************************************
?>
<style type="text/css">
<!--
.message_jv {
	margin-top: 5px;
	border-top: 2px solid rgb(181, 212, 254);
	border-bottom: 2px solid rgb(181, 212, 254);
	padding: 5px 20px 5px 45px;
	background: #e4eef6 ;
	/** -moz-background-clip: -moz-initial;
	-moz-background-origin: -moz-initial;
	-moz-background-inline-policy: -moz-initial; **/
	text-align: left;
}
</style>